<template>
<div class="table-wrap">
  <el-table :data="tableData" :height="tableHeight" v-loading="loading" element-loading-text="新联为您加载数据中" :border='true'
  stripe>
    <el-table-column 
      v-for="col in tableMeta"
      :row-key="col"
      :key="col" 
      :prop="col.prop" 
      :label="col.label" 
      :sortable="col.sortable" 
      :width="col.width" 
      :formatter="col.formatter"
      
      :fixed="col.fixed"
    >
    </el-table-column>
    <slot name="special"></slot>
    <slot name="special2"></slot>
  </el-table>
  <pagination 
    :paginationData="pagination"
    :currentPage="currentPage"
    @getNextPageData="getNextPageData"
    ref='pagination'
    id='footer'
  ></pagination>
</div>
</template>

<script>
// http://cn.vuejs.org/v2/guide/list.html#key
import pagination from './pagination'
export default {
  name: 'pkg2Table',
  components: {
    pagination
  },
  data () {
    return {
    }
  },
  props: {
    tableData: Array,
    tableMeta: Array,
    pagination: Object,
    currentPage: Number,
    loading: Boolean,
    tableHeight: {
      type: Number,
      default: 450
    }
  },
  methods: {
    getNextPageData (page) {
      this.$emit('getNextPageData', page)
    }
  },
  mounted () {
  }
}

</script>

<style lang="scss">
  .table-wrap{
    margin: 5px 0 0;
  }
</style>